<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link href="css/table.css" rel="stylesheet" type="text/css">
    <link rel="stylesheet" type="text/css" href="css/style.css" />
    <link href="../layui-master/dist/css/layui.css" rel="stylesheet" type="text/css">
    <script src="../layui-master/dist/layui.js"></script>
    <script>
        KindEditor.ready(function(K) {
            var editor1 = K.create('textarea[name="content1"]', {
                cssPath : '../kindeditor-4.1.9/plugins/code/prettify.css',
                uploadJson : '../kindeditor-4.1.9/php/upload_json.php',
                fileManagerJson : '../kindeditor-4.1.9/php/file_manager_json.php',
                allowFileManager : true,
                afterCreate : function() {
                    var self = this;
                    K.ctrl(document, 13, function() {
                        self.sync();
                        K('form[name=example]')[0].submit();
                    });
                    K.ctrl(self.edit.doc, 13, function() {
                        self.sync();
                        K('form[name=example]')[0].submit();
                    });
                }
            });
            prettyPrint();
        });
    </script>
    <title>添加银行</title>
    <?php
    include("admin_check.php");
    include_once("../function.php");
    session_start();
    header("Content-Type: text/html;charset=utf-8");
    checkqx(2,13);

    if ($_POST['button']){
        $bankname=$_POST['bankname'];

        $sql="insert into bankname (bankname) VALUE ('$bankname')";
        mysql_query($sql);
        echo "<script language=javascript>alert('添加银行成功.');window.location.href='admin_jiesuan.php'</script>";

    }
    if($_GET['typeid']){
        $id=$_GET['typeid'];
        $sql="delete from bankname where id=".$id;
        mysql_query($sql);
        echo "<script language=javascript>alert('删除银行类型成功.');window.location.href='?'</script>";
    }
    ?>
    <script language="javascript">

        function GetImgName(){
            //根据iframe的id获取对象
            //var i1 = window.frames['UploadFiles'];
            //获取iframe中的元素值
            var i2=document.getElementById("UploadFiles").contentWindow;

            var imgname=i2.document.getElementById("imgname").value;

            //var imgname=i1.document.getElementById("imgname").value;

            document.getElementById("goodsimg").value = imgname;
        }
        -->
    </script>
</head>
<body>
<form name="form1" method="post" action="?"  >
    <table  width="90%" height="100" cellpadding="3" cellspacing="1" border="0" align="center" class="layui-table" lay-skin="line">
        <tr>
            <td height="21" colspan="2" align="center">添 加 银 行</td>
        </tr>
        <tr>
            <td height="22" align="right">银行名称：</td>
            <td align="left"><input name="bankname" type="text" id="bankname" size="20" maxlength="50"></td>
        </tr>
        <tr>
           <td align="center" colspan="2"><input name="button" id="button" type="submit" class="layui-btn layui-btn-small" value="添加">&nbsp;&nbsp;
               <input type="button" class="layui-btn layui-btn-small" onClick="javascript:history.back();" value="返回"></td>

        </tr>
    </table>
</form>
<form name="form1" method="post" action="?"  class="layui-table" lay-skin="line">
    <table width="40%" height="400" cellpadding="3" cellspacing="1" border="0" align="center" class="table1"width="90%" height="450" cellpadding="3" cellspacing="1" border="0" align="center" class="table1">
        <?php
        $sql="select * from bankname where 1=1";
        $query=mysql_query($sql);
        while ($types=mysql_fetch_assoc($query)){

            ?>
            <tr><td height="21px"  align="center"><?=$types['bankname']?></td><td> <input type="button" class="layui-btn layui-btn-small layui-btn-radius layui-btn-danger" id="button" name="button2" value="删除" onClick="window.location.href='admin_jiesuan.php?typeid=<?=$types['id']?>'" /></td></tr>
            <?php
        }
        ?>
    </table>
</form>
</body>
</html>